Improve code coverage with unit and integration tests#32
Merged
Malcolmnixon merged 4 commits intomainfrom Jan 21, 2026
Merged
Conversation
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Malcolmnixon
approved these changes
Jan 21, 2026
Contributor
|
@copilot The coverage numbers are still quite low. Consider enhancing the test project with:
|
Copilot
AI
changed the title
[WIP] Add tests to improve code coverage
Improve code coverage with targeted unit tests
Jan 21, 2026
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot
AI
changed the title
Improve code coverage with targeted unit tests
Improve code coverage with unit and integration tests
Jan 21, 2026
Malcolmnixon
approved these changes
Jan 21, 2026
22 tasks
Malcolmnixon
added a commit
that referenced
this pull request
Feb 20, 2026
* Initial plan * Apply TemplateDotNetTool consistency improvements - Add end_of_line=lf to .editorconfig for consistent line endings - Add MD025 rule to .markdownlint-cli2.jsonc and remove inline comments - Convert README badges to reference-style links matching template pattern - Add comprehensive XML documentation to Context.cs ArgumentParser class - Improve catch block documentation with expected exception types - Reorganize test project .csproj with section comments for clarity - Clean up workflow YAML comments to match template style All changes maintain functionality while improving consistency with the TemplateDotNetTool template standards. * Fix requirements test coverage linkage - Updated platform requirements (PLT-001 through PLT-005) to use correct test source patterns matching CI workflow naming - Changed from generic prefixes (windows@, ubuntu@, dotnet8.x@) to actual CI file patterns (windows-latest@, integration-test-*-dotnet*.x@) - Ensures requirements can be satisfied when full CI pipeline runs - Enhanced VAL-003 and VAL-004 test coverage by adding self-validation tests - These tests exercise both TRX and JUnit format support through the validation functionality - Provides comprehensive validation of format support requirements - All 24 locally-testable requirements are now satisfied - 5 platform-specific requirements (PLT-*) correctly remain unsatisfied locally (requires CI matrix) - Verified with 'dotnet reqstream --enforce' * fix: Exclude node_modules from yamllint checks The yamllint configuration was linting node_modules directory, causing false positives from third-party dependencies. This change adds an ignore section to exclude node_modules and .git directories from yamllint checks, focusing on project files only. * docs: Fix documentation formatting and add missing scope section Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Enhance XML documentation and literate programming style Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Improve test naming and fix cspell dictionary Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * docs: Restructure user guide heading hierarchy for PDF compilation Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * fix: Update requirements.yaml header comment and revert test source filter changes Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Synchronize with TemplateDotNetTool template PRs #29, #31, #32, #35 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code coverage was at 54.88%. Added 26 tests (12 unit tests + 14 integration tests) targeting uncovered paths in core classes.
Coverage Improvements
Changes
New test files:
SonarHotSpotTests.cs- Record property validation and null handlingSonarIssueTests.cs- Record property validation across all severity levelsRunner.cs- Helper class for running SonarMark through dotnet for integration testingIntegrationTests.cs- 14 integration tests exercising the full application via command-lineEnhanced existing tests:
ProgramTests.cs- Error handling for missing required parameters (--server, --project-key)ContextTests.cs- Invalid log file path exception handlingIntegration Tests
The integration tests exercise the complete application by running it through
dotnet exec, covering:All tests follow existing MSTest v4 conventions with
ClassName_MethodUnderTest_Scenario_ExpectedBehaviornaming.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.